import com.beans.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class App2 {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        // 还是一样的，A 先做出修改
        BeanScope beanScope= context.getBean("beanScope",BeanScope.class);
        System.out.println("beanScope: " + beanScope.getUser());

        // 此时，B再来访问
        BeanScope2 beanScope2 = context.getBean("beanScope2",BeanScope2.class);
        System.out.println("beanScope2: " +beanScope2.getUser());


//        UserController3 userController3 = context.getBean("userController3", UserController3.class);
//        userController3.sayHi();
    }
}
